libxl: New utility functions in for reading and writing files.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 12 Apr 2010 16:39:29 +0000 (17:39 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 12 Apr 2010 16:39:29 +0000 (17:39 +0100)
commiteb67817b1764ae94893684883d92959e71bb7a13
treedb1062ee0ad8fda17e3f85e8171c7fed20d10846
parent4f7fb696611fdb1dbb781b7a236f3bc6a4d5bfee
libxl: New utility functions in for reading and writing files.

We introduce these functions in libxl_utils.h:

  int libxl_read_file_contents(struct libxl_ctx *ctx, const char
  *filename,
                               void **data_r, int *datalen_r);
  int libxl_read_exactly(struct libxl_ctx *ctx, int fd, void *data,
  ssize_t sz,
                         const char *filename, const char *what);
  int libxl_write_exactly(struct libxl_ctx *ctx, int fd, const void
  *data,
                          ssize_t sz, const char *filename, const char
  *what);

They will be needed by the following patches.  They have to be in
libxl.a rather than libxutil.a because they will be used, amongst
other places, in libxl itself.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
tools/libxl/libxl_utils.c
tools/libxl/libxl_utils.h